Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor!: putContext returns after reconciliation #179

Closed
wants to merge 4 commits into from

Conversation

fabriziodemaria
Copy link
Member

WIP

Comment on lines -145 to +146
let expectation = expectation(description: "context is synced")
let cancellable = confidence.contextReconciliatedChanges.sink { _ in
expectation.fulfill()
}
confidence.putContext(context: ["targeting_key": .init(string: "user2")])
await fulfillment(of: [expectation], timeout: 1)
cancellable.cancel()

await confidence.putContext(context: ["targeting_key": .init(string: "user2")])
Copy link
Member Author

@fabriziodemaria fabriziodemaria Nov 21, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This reflects well the change: users can now wait for the context to be reconciled in the flags' cache, before getEvaluation. Before this was not possible, as contextReconciliatedChanges is internal

}
}

public func putContext(context: ConfidenceStruct) {

public func putContextLocal(context: ConfidenceStruct, removeKeys removedKeys: [String] = []) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a draft API (not in our internal specs yet). This is to experiment how to solve the integration with the OF layer

@fabriziodemaria fabriziodemaria deleted the putctx-async branch December 10, 2024 15:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant